package com.api.shopapi.mapper;

import com.api.shopapi.entity.NursingSchedulingMorning;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

@Repository
@Mapper
public interface NursingSchedulingMorningMapper {

    @Insert("insert into  nursing_scheduling_morning " +
            "(NursingSchedulingMorningCode,NursingSchedulingCode) " +
            "values (#{nursingSchedulingMorning.NursingSchedulingMorningCode} ,#{nursingSchedulingMorning.NursingSchedulingCode} )")
    int insert(@Param("nursingSchedulingMorning") NursingSchedulingMorning nursingSchedulingMorning);

    @Update("update nursing_scheduling_morning set NursingSchedulingCode=#{nursingSchedulingMorning.NursingSchedulingCode} where NursingSchedulingMorningCode=#{nursingSchedulingMorning.NursingSchedulingMorningCode}   ")
    int updateByNursingSchedulingMorningCode(@Param("nursingSchedulingMorning") NursingSchedulingMorning nursingSchedulingMorning);

    @Delete("delete from nursing_scheduling_morning where nursingSchedulingMorningCode=#{nursingSchedulingMorningCode} ")
    int deleteByNursingSchedulingMorningCode(@Param("nursingSchedulingMorningCode")String nursingSchedulingMorningCode);

    @Select("select * from nursing_scheduling_morning where NursingSchedulingMorningCode=#{nursingSchedulingMorningCode} limit 1")
    NursingSchedulingMorning getByNursingSchedulingMorningCode(@Param("nursingSchedulingMorningCode")String nursingSchedulingMorningCode);

    @Select("select * from nursing_scheduling_morning where NursingSchedulingCode=#{nursingSchedulingCode} limit 1")
    NursingSchedulingMorning getByNursingSchedulingCode(@Param("nursingSchedulingCode") String nursingSchedulingCode);
}
